package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ForwardMessageMapper;
import com.ruoyi.system.domain.ForwardMessage;
import com.ruoyi.system.service.IForwardMessageService;

/**
 * 转发消息关联（存储转发消息与原始消息的关联关系）Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class ForwardMessageServiceImpl implements IForwardMessageService 
{
    @Autowired
    private ForwardMessageMapper forwardMessageMapper;

    /**
     * 查询转发消息关联（存储转发消息与原始消息的关联关系）
     * 
     * @param id 转发消息关联（存储转发消息与原始消息的关联关系）主键
     * @return 转发消息关联（存储转发消息与原始消息的关联关系）
     */
    @Override
    public ForwardMessage selectForwardMessageById(Long id)
    {
        return forwardMessageMapper.selectForwardMessageById(id);
    }

    /**
     * 查询转发消息关联（存储转发消息与原始消息的关联关系）列表
     * 
     * @param forwardMessage 转发消息关联（存储转发消息与原始消息的关联关系）
     * @return 转发消息关联（存储转发消息与原始消息的关联关系）
     */
    @Override
    public List<ForwardMessage> selectForwardMessageList(ForwardMessage forwardMessage)
    {
        return forwardMessageMapper.selectForwardMessageList(forwardMessage);
    }

    /**
     * 新增转发消息关联（存储转发消息与原始消息的关联关系）
     * 
     * @param forwardMessage 转发消息关联（存储转发消息与原始消息的关联关系）
     * @return 结果
     */
    @Override
    public int insertForwardMessage(ForwardMessage forwardMessage)
    {
        forwardMessage.setCreateTime(DateUtils.getNowDate());
        return forwardMessageMapper.insertForwardMessage(forwardMessage);
    }

    /**
     * 修改转发消息关联（存储转发消息与原始消息的关联关系）
     * 
     * @param forwardMessage 转发消息关联（存储转发消息与原始消息的关联关系）
     * @return 结果
     */
    @Override
    public int updateForwardMessage(ForwardMessage forwardMessage)
    {
        forwardMessage.setUpdateTime(DateUtils.getNowDate());
        return forwardMessageMapper.updateForwardMessage(forwardMessage);
    }

    /**
     * 批量删除转发消息关联（存储转发消息与原始消息的关联关系）
     * 
     * @param ids 需要删除的转发消息关联（存储转发消息与原始消息的关联关系）主键
     * @return 结果
     */
    @Override
    public int deleteForwardMessageByIds(Long[] ids)
    {
        return forwardMessageMapper.deleteForwardMessageByIds(ids);
    }

    /**
     * 删除转发消息关联（存储转发消息与原始消息的关联关系）信息
     * 
     * @param id 转发消息关联（存储转发消息与原始消息的关联关系）主键
     * @return 结果
     */
    @Override
    public int deleteForwardMessageById(Long id)
    {
        return forwardMessageMapper.deleteForwardMessageById(id);
    }
}
